//
//  ViewController.swift
//  ResponsibilityChainDemo
//
//  Created by aron on 2017/5/30.
//  Copyright © 2017年 aron. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        let bossLeader = BossLeader();
        let managerLeader = ManagerLeader();
        let groupLeader = GroupLeader();
        groupLeader.nextLeader = managerLeader
        managerLeader.nextLeader = bossLeader
        
        let expense = Expense(title: "报销单10002元", price: 10002)
        groupLeader.handleExpense(expense: expense)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        let handler = HanderOne();
        let handler2 = HandlerTwo();
        
        handler2.nextHandler = handler;
        
        handler2.handleResult(obj: "3")
    }
}

